<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="http://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<script type="text/javascript">
	
	$(function(){
		$("#showAllUsers").on("click",function(){
			var obj={type:"GET",url:"users"};
			$.ajax(obj).done(function(res){
				createTable(res);
			});
			
			
		});
		
		function createTable(res){
			
			for(var i=0;i<res.length;i++){
				var user=res[i];
				$("<tr>").append($("<td>").text(user.id))
				.append($("<td>").text(user.uname))
				.append($("<td>").text(user.age))
				.appendTo($("#userList"));
			}
		}
		
	});
	
	

</script>

</head>
<body>
<button class="btn-primary" id="showAllUsers">showAllUsers</button>
<table id="userList" class="table table-striped">
	<tr><th>id</th><th>uname</th><th>age</th></tr>
</table>



</table>


</body>
</html>